home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2010 November / maximum-cd-2010-11.iso / DiscContents / xbmc-9.11.exe / plugins / Programs / SVN Repo Installer / default.py next >
Encoding:
Python Source  |  2009-11-03  |  2.8 KB  |  69 lines

  1. """
  2.     Plugin for downloading scripts/plugins/skins from SVN repositoriess
  3. """
  4.  
  5. # main imports
  6. import sys
  7. import xbmc
  8.  
  9. # plugin constants
  10. __plugin__ = "SVN Repo Installer"
  11. __author__ = "nuka1195/BigBellyBilly"
  12. __url__ = "http://code.google.com/p/xbmc-addons/"
  13. __svn_url__ = "http://xbmc-addons.googlecode.com/svn/trunk/plugins/programs/SVN%20Repo%20Installer"
  14. __credits__ = "Team XBMC"
  15. __version__ = "1.8.2b"
  16. __date__ = "$Date: 2009-10-13 15:23:59 +0200 (Di, 13 Okt 2009) $"
  17. __svn_revision__ = "$Revision: 1352 $"
  18. __XBMC_Revision__ = "19001"
  19.  
  20. def _check_compatible():
  21.     try:
  22.         # spam plugin statistics to log
  23.         xbmc.log( "[PLUGIN] '%s: Version - %s-r%s' initialized!" % ( __plugin__, __version__, __svn_revision__.replace( "$", "" ).replace( "Revision", "" ).replace( ":", "" ).strip() ), xbmc.LOGNOTICE )
  24.         # get xbmc revision
  25.         xbmc_rev = int( xbmc.getInfoLabel( "System.BuildVersion" ).split( " r" )[ -1 ] )
  26.         # compatible?
  27.         ok = xbmc_rev >= int( __XBMC_Revision__ )
  28.     except:
  29.         # error, so unknown, allow to run
  30.         xbmc_rev = 0
  31.         ok = 2
  32.     # spam revision info
  33.     xbmc.log( "     ** Required XBMC Revision: r%s **" % ( __XBMC_Revision__, ), xbmc.LOGNOTICE )
  34.     xbmc.log( "     ** Found XBMC Revision: r%d [%s] **" % ( xbmc_rev, ( "Not Compatible", "Compatible", "Unknown", )[ ok ], ), xbmc.LOGNOTICE )
  35.     # if not compatible, inform user
  36.     if ( not ok ):
  37.         import xbmcgui
  38.         xbmcgui.Dialog().ok( "%s - %s: %s" % ( __plugin__, xbmc.getLocalizedString( 30700 ), __version__, ), xbmc.getLocalizedString( 30701 ) % ( __plugin__, ), xbmc.getLocalizedString( 30702 ) % ( __XBMC_Revision__, ), xbmc.getLocalizedString( 30703 ) )
  39.     #return result
  40.     return ok
  41.  
  42.  
  43. if ( __name__ == "__main__" ):
  44.     if ( not sys.argv[ 2 ] ):
  45.         # check for compatibility, only need to check this once, continue if ok
  46.         if ( _check_compatible() ):
  47.             from installerAPI import xbmcplugin_list as plugin
  48.     elif ( "show_info=" in sys.argv[ 2 ] ):
  49.         from installerAPI import xbmcplugin_info as plugin
  50.     elif ( "delete=" in sys.argv[ 2 ] ):
  51.         from installerAPI import xbmcplugin_actions as plugin
  52.     elif ( "self_update" in sys.argv[ 2 ] ):
  53.         from installerAPI import xbmcplugin_actions as plugin
  54.     elif ( "download_url=" in sys.argv[ 2 ] ):
  55.         from installerAPI import xbmcplugin_downloader as plugin
  56.     elif ( sys.argv[ 2 ] == "?category='updates'" ):
  57.         from installerAPI import xbmcplugin_update as plugin
  58.     elif ( "showreadme=" in sys.argv[ 2 ] or "showlog=" in sys.argv[ 2 ] ):
  59.         from installerAPI import xbmcplugin_logviewer as plugin
  60.     else:
  61.         from installerAPI import xbmcplugin_list as plugin
  62.  
  63.     try:
  64.         plugin.Main()
  65.     except:
  66.         import traceback
  67.         traceback.print_exc()
  68. #        pass
  69.